package com.android.nextBus.Activities;

import com.android.nextBus.DB.SQLiteOperationsWrapper;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.widget.RelativeLayout;

public class SplashActivity extends Activity
{   
    private SQLiteOperationsWrapper db;
    private int firstTimeFlag;

    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);

//        db = new SQLiteOperationsWrapper(this);
//        db.open();
//        
//         firstTimeFlag =db.isFirstTime();
//
//         db.close();
        Handler handler = new Handler();
        handler.removeCallbacks(runnable);
        handler.postDelayed(runnable, 3000L);

        
    }

    Runnable runnable = new Runnable() 
    {
        public void run() 
        {



        	if(firstTimeFlag == 0){
                Intent intent = new Intent(SplashActivity.this,MainMenuActivity.class);
                startActivity(intent);
                finish();
        	}else{
        		Intent intent = new Intent(SplashActivity.this,AccountCreationActivity.class);
                startActivity(intent);
                finish();
        	}
        	//if(firstTimeFlag == 0){
            Intent intent = new Intent(SplashActivity.this,MainMenuActivity.class);
            startActivity(intent);
            finish();
        	//}else{
        	//	Intent intent = new Intent(SplashActivity.this,AccountCreationActivity.class);
            //    startActivity(intent);
            //    finish();
        	//}
        	

        }
    };

}